//
//  HLVideoGuideAttachment.m
//  YueYue
//
//  Created by hulu001 on 2023/6/12.
//

#import "HLVideoGuideAttachment.h"

@implementation HLVideoGuideAttachment

- (nonnull NSString *)encodeAttachment {
    NSDictionary *dict = @{
                           @"msgType" : @(15),
                           @"body" : @{
                               @"title" : self.title?:@"",
                               @"content" : self.content?:@""
                                    }
                           };
    
    NSData *data = [NSJSONSerialization dataWithJSONObject:dict
                                                   options:0
                                                     error:nil];
    NSString *content = nil;
    if (data) {
        content = [[NSString alloc] initWithData:data
                                        encoding:NSUTF8StringEncoding];
    }
    return content;
}

- (CGSize)contentSize:(NIMMessage *)message cellWidth:(CGFloat)width
{
    return CGSizeMake(266, 134);
}

- (NSString *)cellContent:(NIMMessage *)message
{
    return @"HLVideoGuideContentView";
}

- (UIEdgeInsets)cellInsets:(NIMMessage *)message
{
    return UIEdgeInsetsMake(8, 12, 28, 12);
}

- (UIEdgeInsets)contentViewInsets:(NIMMessage *)message
{
    return UIEdgeInsetsZero;
}

- (BOOL)shouldShowAvatar:(NIMMessage *)message
{
    return NO;
}


@end
